package com.tarena.lbs.user.dao.repository.impl;

import com.tarena.lbs.user.dao.mapper.UserGroupMapper;
import com.tarena.lbs.user.dao.repository.UserGroupRepository;
import com.tarena.lbs.user.pojo.po.UserGroupPO;
import com.tarena.lbs.user.pojo.vo.UserGroupVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class UserGroupRepositoryImpl implements UserGroupRepository {
    @Autowired
    private UserGroupMapper userGroupMapper;
    @Override
    public Integer saveUserGroup(UserGroupPO userGroupPO) {
        Integer result = userGroupMapper.insert(userGroupPO);
        return result;
    }

    @Override
    public List<UserGroupVO> rgetUserGroupsByBizId(Integer businessId) {
        return userGroupMapper.selectUserGroupsByBusiness(businessId);

    }
}
